﻿#ifndef __ILOGGER_H__
#define __ILOGGER_H__

#include "Common.h"

namespace sky
{
    // 日志级别
    enum LogLevel
    {
        LogLevel_Info        = 0x1,     // 输出详细信息
        LogLevel_Trace       = 0x2,     // 输出Trace信息
        LogLevel_Warning     = 0x4,     // 输出警告信息
        LogLevel_Error       = 0x8,     // 输出错误信息
        LogLevel_Emphasis    = 0x10,    // 输出强调信息

        LogLevel_All = LogLevel_Info | LogLevel_Trace | LogLevel_Warning | LogLevel_Error | LogLevel_Emphasis,
    };

    // 日志输出目标
    class SKY_EXPORT LogAppender
    {
    protected:
        int m_nLevel;
        bool m_bHasTime;

    public:
        LogAppender() : m_nLevel(LogLevel_All), m_bHasTime(false)
        {

        }

        virtual ~LogAppender() 
        {

        }

        void setLevl(int level)
        {
            m_nLevel = level;
        }

        int getLevel()
        {
            return m_nLevel;
        }

        void setHasTime(bool hasTime)
        {
            m_bHasTime = hasTime;
        }

        bool hasTime()
        {
            return m_bHasTime;
        }

        virtual void Log(const char * msg, const char * time, LogLevel level)
        {

        }
    };

} // namespace sky


#endif